# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=inquisitor
pkgver=28.12a9ec1
pkgrel=11
epoch=1
pkgdesc='OSINT Gathering Tool for Companies and Organizations.'
groups=('blackarch' 'blackarch-recon' 'blackarch-social')
arch=('any')
url='https://github.com/penafieljlm/inquisitor'
license=('custom:unknown')
depends=('python2' 'python2-argparse' 'python2-netaddr' 'python2-python-whois'
         'python2-unidecode' 'python2-tld' 'python2-validate-email'
         'python2-unqlite' 'python2-google-api-python-client' 'python2-shodan'
         'python2-tabulate' 'python2-ipwhois')
makedepends=('git')
source=("git+https://github.com/penafieljlm/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python2 setup.py build
}

package() {
  cd $pkgname

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  # lame code and naming ...
  sed -i "1 i\#!/usr/bin/python2" "$pkgdir/usr/bin/inq"
  mv "$pkgdir/usr/bin/inq" "$pkgdir/usr/bin/$pkgname"
  rm -rf "$pkgdir/usr/lib/python2.7/site-packages/tests"
}

